<?php

/**
 * Class Lib_Repair_Adapter_LianTong
 * 联通失联修复
 * 2020/11/06
{
 */
class Lib_Repair_Implement_YiDong extends Lib_Repair_Base_YD
{
    private static $obj = null;

    /**
     * 单例获取
     * @return Lib_Repair_Implement_YiDong
     */
    public static function getInstance(){
        if (is_null(self::$obj)) {
            self::$obj = new self();
        }
        return self::$obj;
    }
    /**
     * 修复接口
     * @param $data
     * @return array
     */
    public function repair($data) {
        $post_data = $this->buildData($data);
        if(empty($post_data)){
            return $this->returnData(400,'empty post data');
        }
        //接口发送
        return $this->curlPost('/api/lc/batchUpload', $post_data);
    }

    /**
     * 获取修复结果接口
     * @param $data
     * @return array
     */
    public function getRepairResult($data) {
        $post_data = $this->buildData($data);
        if(empty($post_data)){
            return $this->returnData(400,'empty post data');
        }
        //接口发送
        return $this->curlPost('/api/lc/resultMatch', $post_data);
    }

    /**
     * 绑定虚拟小号接口
     * @param $data
     * @return array
     */
    public function binding($data) {
        $post_data = $this->buildData($data);
        if(empty($post_data)){
            Func_Log::write('curl',   'curl_end', json_encode($data).json_encode($post_data));
            return $this->returnData(400,'绑定中间号码参数有误！');
        }
        return $this->curlPost('/api/lc/bindVirtualNo', $post_data);

    }


}